package com.key.mapper;

import com.key.common.dto.AssetsInfoDTO;
import com.key.entity.Assets;
import com.key.entity.AssetsAllocation;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @Author: li
 * @CreateTime: 2023-02-22  14:32
 */
public interface AssetsAllocationMapper {


    /**
     * 显示资产调拨单信息，包括高级搜索
     * @return
     */
    List<AssetsAllocation> selectAllAllocationInfo(AssetsAllocation assetsAllocation);


    /**
     * 根据id修改资产调拨单状态以及调入时间
     * @param allocationId
     * @param inDate
     * @return
     */
    int updateAllocationState(@Param("allocationId") Integer allocationId,@Param("inDate") String inDate);


    /**
     * 根据调拨单号查询资产id
     * @return
     */
    List<Map<String,Long>> selectAssetsNumInfoByAllocationId(String AllocationNum);


    /**
     * 根据调拨单号修改资产相关状态
     * @param assetsId
     * @return
     */
    int updateAssetsInfoByAllocationId(@Param("assetsId")Long assetsId,@Param("assetsManagerId")String assetsManagerId,@Param("assetsAdminId")String assetsAdminId);

    /**
     * 根据资产调拨单号查询单个调拨单信息
     * @param allocationId
     * @return
     */
    AssetsAllocation selectAllocationInfoById(Integer allocationId);


    /**
     * 根据资产调拨单id删除资产调拨单
     * @param allocationId
     * @return
     */
    int deleteAllocationInfoById(Integer allocationId);


    /**
     * 在取消调入时，根据调拨单号修改资产相关状态
     * @param assetsId
     * @return
     */
    int updateAssetsInfoByAllocationIdNo(Long assetsId);


    /**
     * 根据调拨单号查询所对应资产信息
     * @param allocationNum
     * @return
     */
    List<AssetsInfoDTO> selectAssetsByAllocationNum(String allocationNum);


    /**
     * 修改单个资产调拨单信息
     * @param allocationId
     * @param inPerson
     * @param inCompany
     * @param description
     * @return
     */
    int updateAllocationInfo(@Param("allocationId") Integer allocationId,@Param("inPerson")String inPerson,
                             @Param("inCompany")String inCompany,@Param("description")String description);



}
